import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component:()=>import('@/layout/index.vue'),
      redirect:'/home',
      children:[
        {
          path:'/home',
          name:'home',
          component:()=>import('@/views/home-page/index.vue')
        },
        {
          path:'/product',
          name:'product',
          component:()=>import('@/views/product-center/index.vue')
        },
        {
          path:'/product-detail',
          name:'detail',
          component:()=>import('@/views/product-center/ProductDetail.vue')
        },
        {
          path:'/case',
          name:'case',
          component:()=>import('@/views/success-case/index.vue')
        },
        {
          path:'/teamwork',
          name:'teamwork',
          component:()=>import('@/views/teamwork-page/index.vue')
        },
        {
          path:'/about',
          name:'about',
          component:()=>import('@/views/about-us/index.vue'),
          children:[
            { path:'/about', name:'intro', component:()=>import('@/views/about-us/CompanyIntro.vue') },
            { path:'/about/news', name:'news', component:()=>import('@/views/about-us/NewsList.vue' )}
          ]
        }
      ]
    }
  ]
})

export default router
